package IncreasingTripletSubsequence;

public class Solution {
    public boolean increasingTriplet(int[] nums) {
       Integer x1=null,x2 = null;
       if (nums==null||nums.length<3) return false;
       x1=nums[0];
       for (int i=1;i<nums.length;i++){
    	   if (x2==null)
    		   if (nums[i]>x1) x2=nums[i];
    		   else x1=nums[i];
    	   else{
    		   if (nums[i]>x2) return true;
    		   else if (nums[i]>x1) x2=nums[i];
    		   else x1=nums[i];
    	   }
       }
       return false;
    }
    public static void main(String args[]) {
    	int[] t={1,1,1,1,1,1,1,1};
    	Solution so=new Solution();
    	System.out.println(so.increasingTriplet(t));
		
	}
}
